const express = require("express");
var bodyParser = require("body-parser");
const router = express.Router();
var urlencodedParser = bodyParser.urlencoded({ extended: false });
const Mock = require("mockjs");
router.post("/passReigster", urlencodedParser, (req, res) => {
  const { isAdop } = req.body;
  const message = isAdop === "pass" ? "通过成功" : "驳回成功";
  const data = {
    code: 200,
    data: {
      list: [],
      message,
    },
  };
  res.json(data);
});
router.post("/regTable", (req, res) => {
  const data = Mock.mock({
    code: 200,
    data: {
      "dataSource|50": [
        {
          "id|+1": 1,
          name: " @cword(2,4)",
          telPhone: "@natural()",
          passworld: '@string("upper", 10)',
          "status|1-2": true,
          phone: "@integer()",
        },
      ],
      total: 50,
      currentPage: 1,
      pageSize: 10,
    },
  });
  res.json(data);
});

module.exports = router;
